﻿using backYu.App_Start;
using Swashbuckle.Application;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;

[assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")]
namespace backYu.App_Start
{
    public class SwaggerConfig
    {
        /// <summary>
        /// 具体配置
        /// </summary>
        public static void Register()
        {
            var thisAssembly = typeof(SwaggerConfig).Assembly;
            GlobalConfiguration.Configuration.EnableSwagger(
                c =>
                {
                    c.UseFullTypeNameInSchemaIds();
                    c.SingleApiVersion("v1", "backYu");
                    c.ResolveConflictingActions(apiDescription => apiDescription.First());
                    c.IncludeXmlComments($"{System.AppDomain.CurrentDomain.BaseDirectory}/bin/backYu.xml");
                })
                    .EnableSwaggerUi(
                    c =>
                    {
                    });
        }
    }
}